<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
    <div class="easyui-panel"  style="padding:20px 10px;height:100%">
        <form id="basedata-add-form" method="post"  style="width:100%;margin:0 auto">
         
           
            <div style="margin-bottom:20px">
                <input class="easyui-textbox" name="text" style="width:100%" data-options="label:'名称:',required:true">
            </div>
            
            <div style="margin-bottom:20px">
                <input class="easyui-numberbox" name="value" style="width:100%" data-options="label:'数值:',required:true,precision:2">
            </div>
           
             <div style="margin-bottom:20px">
                <input class="easyui-numberspinner" name="seq" style="width:100%" data-options="label:'排序:',required:true,value:0,min:0,max:100">
            </div>
           
             <div style="margin-bottom:20px">
                <input class="easyui-textbox" name="description" style="width:100%;height:80px" data-options="label:'备注:',multiline:'true'">
            </div>
            
        </form>
        <div style="text-align:center;padding:5px 0">
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm_AddBasedata()" style="width:80px">保存</a>          
        </div>
    </div>





<script>          
function submitForm_AddBasedata(){
	    $.messager.progress();
	     $('#basedata-add-form').form('submit',{
	        url:'${Domain}api/basedata/add',
	        onSubmit: function(param){   
	              var isValid = $(this).form('validate');
					if (!isValid){
						$.messager.progress('close');	// 如果表单是无效的则隐藏进度条
							return false;
					}	 	  		  
				    
				},
				success:function(data){
				var json = eval('(' + data + ')');  // change the JSON string to javascript object
				if (json.status){
				 	$.messager.show({
		                title:'提示',
		                msg:'更新完成',
		                timeout:2000,
		                showType:'slide'
	            	});	
	            	$('#tngou-win').window('close');	
	            	$('#basedata-table').datagrid("reload");				 				           
				}else
				{
					$.messager.alert('提示',json.msg,'error');
				}
					   
				$.messager.progress('close');
		}
	  });
}


	        
</script>


</body>
</html>